home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / frosty-logo.scm.z / frosty-logo.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  3.8 KB  |  89 lines

  1. ;  FROZEN-TEXT effect
  2. ;  Thanks to Ed Mackey for this one
  3. ;   Written by Spencer Kimball
  4.  
  5. (define (min a b) (if (< a b) a b))
  6.  
  7. (define (script-fu-frosty-logo text size font bg-color)
  8.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  9.      (border (/ size 5))
  10.      (text-layer (car (gimp-text img -1 0 0 text (* border 2) TRUE size PIXELS "*" font "*" "*" "*" "*")))
  11.      (width (car (gimp-drawable-width text-layer)))
  12.      (height (car (gimp-drawable-height text-layer)))
  13.      (text-layer-mask (car (gimp-layer-create-mask text-layer BLACK-MASK)))
  14.      (sparkle-layer (car (gimp-layer-new img width height RGBA_IMAGE "Sparkle" 100 NORMAL)))
  15.      (matte-layer (car (gimp-layer-new img width height RGBA_IMAGE "Matte" 100 NORMAL)))
  16.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 90 MULTIPLY)))
  17.      (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
  18.      (selection 0)
  19.      (old-fg (car (gimp-palette-get-foreground)))
  20.      (old-bg (car (gimp-palette-get-background)))
  21.      (old-brush (car (gimp-brushes-get-brush)))
  22.      (old-paint-mode (car (gimp-brushes-get-paint-mode))))
  23.     (gimp-image-disable-undo img)
  24.     (gimp-image-resize img width height 0 0)
  25.     (gimp-image-add-layer img sparkle-layer 2)
  26.     (gimp-image-add-layer img matte-layer 3)
  27.     (gimp-image-add-layer img shadow-layer 4)
  28.     (gimp-image-add-layer img bg-layer 5)
  29.     (gimp-selection-none img)
  30.     (gimp-edit-clear img sparkle-layer)
  31.     (gimp-edit-clear img matte-layer)
  32.     (gimp-edit-clear img shadow-layer)
  33.     (gimp-selection-layer-alpha img text-layer)
  34.     (set! selection (car (gimp-selection-save img)))
  35.     (gimp-selection-feather img border)
  36.     (gimp-palette-set-background '(0 0 0))
  37.     (gimp-edit-fill img sparkle-layer)
  38.     (plug-in-noisify 1 img sparkle-layer FALSE 0.2 0.2 0.2 0.0)
  39.     (plug-in-c-astretch 1 img sparkle-layer)
  40.     (gimp-selection-none img)
  41.     (plug-in-sparkle 1 img sparkle-layer 0.03 0.45 (/ (min width height) 2) 6 15)
  42.     (gimp-levels img sparkle-layer 1 0 255 0.2 0 255)
  43.     (gimp-levels img sparkle-layer 2 0 255 0.7 0 255)
  44.     (gimp-selection-layer-alpha img sparkle-layer)
  45.     (gimp-palette-set-foreground '(0 0 0))
  46.     (gimp-brushes-set-brush "Circle Fuzzy (11)")
  47.     (gimp-edit-stroke img matte-layer)
  48.     (gimp-selection-feather img border)
  49.     (gimp-edit-fill img shadow-layer)
  50.     (gimp-selection-none img)
  51.     (gimp-palette-set-background bg-color)
  52.     (gimp-edit-fill img bg-layer)
  53.     (gimp-palette-set-background '(0 0 0))
  54.     (gimp-edit-fill img text-layer)
  55.     (gimp-image-add-layer-mask img text-layer text-layer-mask)
  56.     (gimp-selection-load img selection)
  57.     (gimp-palette-set-background '(255 255 255))
  58.     (gimp-edit-fill img text-layer-mask)
  59.     (gimp-selection-feather img border)
  60.     (gimp-selection-translate img (/ border 2) (/ border 2))
  61.     (gimp-edit-fill img text-layer)
  62.     (gimp-image-remove-layer-mask img text-layer 0)
  63.     (gimp-selection-load img selection)
  64.     (gimp-brushes-set-brush "Circle Fuzzy (07)")
  65.     (gimp-brushes-set-paint-mode BEHIND)
  66.     (gimp-palette-set-foreground '(186 241 255))
  67.     (gimp-edit-stroke img text-layer)
  68.     (gimp-selection-none img)
  69.     (gimp-image-remove-channel img selection)
  70.     (gimp-palette-set-foreground old-fg)
  71.     (gimp-palette-set-background old-bg)
  72.     (gimp-brushes-set-brush old-brush)
  73.     (gimp-brushes-set-paint-mode old-paint-mode)
  74.     (gimp-layer-translate shadow-layer border border)
  75.     (gimp-image-enable-undo img)
  76.     (gimp-display-new img)))
  77.  
  78. (script-fu-register "script-fu-frosty-logo"
  79.             "<Toolbox>/Xtns/Script-Fu/Logos/Frosty"
  80.             "Frozen logos with drop shadows"
  81.             "Spencer Kimball & Ed Mackey"
  82.             "Spencer Kimball & Ed Mackey"
  83.             "1997"
  84.             ""
  85.             SF-VALUE "Text String" "\"The GIMP\""
  86.             SF-VALUE "Font Size (in pixels)" "100"
  87.             SF-VALUE "Font" "\"Becker\""
  88.             SF-COLOR "Background Color" '(255 255 255))
  89.